-
Notifications
You must be signed in to change notification settings - Fork 724
net: lib: MQTT 5.0 #2674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
net: lib: MQTT 5.0 #2674
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…T version It should be possible to select maximum supported MQTT version, so that for example MQTT 5.0 features can be compiled-out in case they're not needed. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit f31a45f)
…QTT 5.0 enabled Add test variant which enables MQTT 5.0 support. MQTT 3.1.1 should still work just fine in such case, so it needs to be verified that's the case. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 08f8e2f)
…ngth The macro did not take into account the 2-byte binary data length encoded before the actual binary data. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 1eb9a5c)
Add support for CONNECT message specified in MQTT 5.0, along with property encoders required to encode MQTT properties which is a new concept in MQTT 5.0. Connect and will properties can be specified by the application in the mqtt_client structure before connecting. Introduce a helper function which allows to verify whether MQTT 5.0 is used or not, so that it's still possible to use MQTT 3.1 even if MQTT 5.0 support is enabled in Kconfig. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 8fe2965)
Add support for CONNACK message specified in MQTT 5.0, along with property decoders required to decode MQTT properties. Decoded properties are provided to the application within mqtt_connack_param structure, accompanying the CONNACK event. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 6038676)
Add support for PUBLISH message specified in MQTT 5.0. The message encoder and decoder were updated to support MQTT properties. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 15ad90a)
Add support for PUBACK, PUBREC, PUBREL and PUBCOMP specified in MQTT 5.0. As all of these acknowledgment packets have similar format, introduced a common encoder/decoder to handle ACK packets. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit c21e642)
Add support for SUBSCRIBE/UNSUBSCRIBE messages specified in MQTT 5.0. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit efd795b)
Add support for SUBACK/UNSUBACK messaged specified in MQTT 5.0. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 2459ffa)
Add support for DICONNECT message specified in MQTT 5.0. As with MQTT 5.0, the disconnect can now also be initiated by the broker, it was needed to add decoder support for the message. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 55e1c10)
Add support for a new AUTH message introduced in MQTT 5.0. This is a new mechanism specified by MQTT 5.0, which allows clients and brokers for enhanced authentication in between CONNECT and CONNACK exchange. An additional MQTT event (MQTT_EVT_AUTH) was specified which is triggered when the AUTH packet arrives from the broker. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 1d743fa)
Add support for handling topic aliases received from the broker. The MQTT client implementation will store received topic for further use in case consecutive PUBLISH received from the broker contains no topic but alias only. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit e9da3b3)
…QTT 5.0 As MQTT 5.0 allows to specify the disconnect reason in the Disconnect packet, use this new feature to improve error notification to the broker, according to the error guidelines in the MQTT 5.0 spec. For most cases, a generic arbitrary mapping between errno values and reason codes is used, however the parser can specify the disconnect reason code manually to better handle certain corner cases (like invalid topic alias used). Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 8935579)
…tests Add new test suite covering MQTT 5.0 packet format. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 347653e)
…ntation Make sure conditionally compiled parts of the public header related to MQTT 5.0 support are rendered by doxygen. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit f9b4e27)
MQTT 5.0 is now supported so reflect this in the library documentation. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit e380473)
Contributor
Author
|
@krish2718 Just FYI, this was requested by Ulf some time ago. |
…ompile errors Upstream PR #: 87741 Add some extra ifdefs around MQTT 5.0 specific structures to prevent compiler errors due to undefined symbols in certain configurations. Signed-off-by: Robert Lubos <[email protected]>
|
jukkar
approved these changes
Mar 28, 2025
krish2718
approved these changes
Mar 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Pull MQTT 5.0 support from upstream
manifest-pr-skip